package com.itheima.controller;

import com.alibaba.dubbo.config.annotation.Reference;
import com.itheima.entity.Result;
import com.itheima.pojo.OrderInfo;
import com.itheima.service.OrderService;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("order")
public class OrderController {

    @Reference(version = "1.0")
    OrderService orderService;

    ///order/send?telephone="+telephone
    @GetMapping("send")
    public Result send(String telephone) {
        return orderService.send(telephone);
    }

    @PostMapping("submit")
    public Result submit(@RequestBody OrderInfo orderInfo) {
        return orderService.submit(orderInfo);
    }
    @PostMapping("findById")
    public Result findById(Integer id) {
        return orderService.findById(id);
    }
}
